/*
 * @Author: zhangenze
 * @Date: 2025-03-30 17:26:38
 * @LastEditors: zhangenze
 * @LastEditTime: 2025-03-30 17:28:04
 * @important: 重要提醒
 * @Description: 备注内容
 * @FilePath: \shop-ai-destiny\src\api\index.ts
 */
import { http } from "@/utils/http";
import { getAuthData, ICreateOrderParams } from "@/typings";
/**
 * @typedef {Object} GetAuthRes 置换token的返回
 * @property {number} code
 * @property {Object} data
 * @property {number} data.userId
 * @property {string} data.accessToken
 * @property {string} data.refreshToken
 * @property {number} data.expiresTime - 时间戳 1736579703913,
 * @property {string|null} data.openid
 **/
export const getAuth = async data => {
    return http.request<getAuthData>({
        url: "/member/auth/replacementToken",
        method: "post",
        data: data
    });
};

/**
 * 获取需要的算力值和当前算力值是否足够
 * @param {object} [params] - 可选的查询参数
 */
export function checkCountBalance(data) {
    return http.request<[string, boolean]>({
        url: "/ai/tool-order/checkCountBalance",
        method: "post",
        data
    });
}
